package de.ff7rl.core.effects;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import de.ff7rl.core.battle.BattleParticipant;

public abstract class WithEffects {

  private String name;
  private String description;
  private TargetSize targetSize = TargetSize.ONE;
  private Target defaultTarget = Target.ALLIED;
  private final List<Effect> effects = new ArrayList<Effect>();

  public Target getDefaultTarget() {
    return defaultTarget;
  }

  public String getDescription() {
    return description;
  }

  public List<Effect> getEffects() {
    return effects;
  }

  public String getName() {
    return name;
  }

  public TargetSize getTargetSize() {
    return targetSize;
  }

  public void process(final Set<BattleParticipant> battleParticipants) {
    for (final Effect effect : effects) {
      effect.process(battleParticipants);
    }
  }

  public void setDefaultTarget(final Target theDefaultTarget) {
    defaultTarget = theDefaultTarget;
  }

  public void setDescription(final String theDescription) {
    description = theDescription;
  }

  public void setName(final String theName) {
    name = theName;
  }

  public void setTargetSize(final TargetSize theTargetSize) {
    targetSize = theTargetSize;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String toString() {
    return name;
  }

}
